/**
 * PersonalIdentify 相关逻辑编写实现类
 * @author WangXinLei
 * @date 2015-03-04
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.PersonalIdentify;
import com.chnbst.bstyun.model.vo.PersonalIdentifyVo;
import com.chnbst.bstyun.service.PersonalIdentifyService;

@Transactional
@Service
public class PersonalIdentifyServiceImpl extends BaseService implements PersonalIdentifyService {
	
	private final static String nameSpace = "com.chnbst.bstyun.mapper.PersonalIdentifyMapper";
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertPersonalIdentify(PersonalIdentify personalIdentify) {
		return DaoHelper.insert(nameSpace, "insertPersonalIdentify", personalIdentify);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateById(PersonalIdentify personalIdentify) {
		return DaoHelper.update(nameSpace, "updateById", personalIdentify);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public PersonalIdentify selectById(String id) {
		return (PersonalIdentify)DaoHelper.query(nameSpace, "selectById", id);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public PersonalIdentify selectByUserId(Integer userId) {
		return (PersonalIdentify)DaoHelper.query(nameSpace, "selectByUserId", userId);
	}

	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<PersonalIdentifyVo> selectList() {
		return (List<PersonalIdentifyVo>) DaoHelper.list(nameSpace, "selectList", null);
	}

	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<PersonalIdentifyVo> selectListByCondition(Integer state) {
		return (List<PersonalIdentifyVo>) DaoHelper.list(nameSpace, "selectListByCondition", state);
	}
}
